package com.zmzncs.lmtc.module.order.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zmzncs.lmtc.module.order.pojo.order_info.OrderInfo;
import com.zmzncs.lmtc.module.order.pojo.order_info.OrderInfoDTO;
import com.zmzncs.lmtc.module.order.pojo.order_info.UserOrderInfoForm;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 客户-信息 Mapper 接口
 * </p>
 *
 * @author 任建波
 * @since 2020-09-01
 */
@Repository
public interface OrderInfoDao extends BaseMapper<OrderInfo> {

    /**查询客户当前车辆在停车场情况*/
    List<OrderInfoDTO> getCustomerCarParkList(Long customerId);
    /**查询客户订单*/
    IPage<OrderInfoDTO> getCustomerOrderList(Page page, @Param("form") UserOrderInfoForm form);
    /**根据订单号查询订单*/
    OrderInfoDTO getByOrderCode(String orderCode);
    /**根据车牌号查询客户最后未出场订单*/
    OrderInfoDTO getLastNotOutOrderByCarNumber(@Param("carNumber") String carNumber);

    OrderInfoDTO selectWaitLeaveOrderByCustomerId(Integer customerId, Integer status);
    /**根据车牌号查询未出场订单*/
    List<OrderInfoDTO> getNotOutOrderByCarNumber(@Param("carNumber") String carNumber);
    /**根据交易记录id获取订单*/
    OrderInfoDTO getByOrderTradeRecordId(@Param("orderTradeRecordId") Long orderTradeRecordId);

}
